package com.etc.test;

import java.util.Date;
import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.etc.entity.Outpatientservicetype;
import com.etc.entity.Registration;
import com.etc.service.RegistrationService;

/**
 * 预约挂号测试
 * 
 * @author 小白
 *
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:applicationContext.xml", "classpath:mybatis-config.xml" })
public class RegistrationTestJUnit {
	@Autowired
	private RegistrationService registrationService;
	/**
	 * 增加预约测试
	 */
	@Test
	public void addRegistration() {
		String time=new Date().toLocaleString();
		Registration record=new Registration("2",1,time);
		int n=registrationService.insert(record);
		System.out.println(n);
		

		
		}
		
		/**
		 * 查询所有挂号测试
		 */
		@Test
		public void setRegistration() {
			List<Registration> Registration = registrationService.selectRegistration();
			Registration.forEach(System.out::println);
	}
}
